import request from '@/utils/request'

// 查询志愿征集轮次信息列表
export function listRound(query) {
  return request({
    url: '/mentor/round/list',
    method: 'get',
    params: query
  })
}

// 查询志愿征集轮次信息详细
export function getRound(id) {
  return request({
    url: '/mentor/round/' + id,
    method: 'get'
  })
}

// 新增志愿征集轮次信息
export function addRound(data) {
  return request({
    url: '/mentor/round',
    method: 'post',
    data: data
  })
}

// 修改志愿征集轮次信息
export function updateRound(data) {
  return request({
    url: '/mentor/round',
    method: 'put',
    data: data
  })
}

// 删除志愿征集轮次信息
export function delRound(id) {
  return request({
    url: '/mentor/round/' + id,
    method: 'delete'
  })
}

// 导出志愿征集轮次信息
export function exportRound(query) {
  return request({
    url: '/mentor/round/export',
    method: 'get',
    params: query
  })
}

//获取当前时间是否在可选时间内 0获取学生时间 1获取导师时间
export function isSelect(type) {
  return request({
    url: `/mentor/round/isSelect/${type}`,
    method: 'get'
  })
}

//获取激活的选择时间
export function getNewRound() {
  return request({
    url: `/mentor/round/active`,
    method: 'get'
  })
}


//设置当前轮次为激活状态
export function active(id) {
  return request({
    url: `/mentor/round/active/${id}`,
    method: 'post'
  })
}

//取消激活
export function noActive() {
  return request({
    url: `/mentor/round/noActive`,
    method: 'post'
  })
}
